import axios from 'axios'

let server = axios.create({
  timeout: 1000
})

// 响应拦截器
server.interceptors.response.use(res => res.data, err => Promise.reject(err))

export const get = (url, config = {}) => server.get(url, config)
export const post = (url, data = {}, config = {}) => server.post(url, data, config)
export const put = (url, data = {}, config = {}) => server.put(url, data, config)
export const del = (url, data = {}, config = {}) => server.delete(url, data, config)